<?php

namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class Files extends Controller
{
    //图片上传
    public function upload_img(Request $request)
    {
        $path = $request->file('file')->store('public/avatars/'.date('Y/m/d'));
        $url = Storage::url($path);
        exit(json_encode(array('code'=>0,'msg'=>'','data'=>array('src'=>$url))));
        // linux 创建软连接 ln -s /www/admin/demo2.nmgseozx.com_80/wwwroot/storage/app/public /www/admin/demo2.nmgseozx.com_80/wwwroot/public/storage
    }
}
